-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update _sklearn.py #67
base: master
Are you sure you want to change the base?
Conversation
check for horizon before X_fit is transformed
if self.optimize_for_horizon: | ||
lenX=len(X) | ||
else: | ||
lenX=0 | ||
X_fit, y_fit = self._transform_data_to_tsmodel_input_format(self._X, self._y, lenX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.optimize_for_horizon: | |
lenX=len(X) | |
else: | |
lenX=0 | |
X_fit, y_fit = self._transform_data_to_tsmodel_input_format(self._X, self._y, lenX) | |
X_fit, y_fit = self._transform_data_to_tsmodel_input_format(self._X, self._y, len(X) if self.optimize_for_horizon else 0) |
@ambader Could you bit more explain the idea behind the MR in the description? |
Sure, I tried to solve the issue raised by @lucheroni (see). It been a while, so Im not totally sure about the details, but as far as i remember, the problem was that hcrystalball sets the length of periods to predict (the horizon) automatically. What I added is a way to check if the users tries to set another length and hands it over to the sklearn function, which can handle the new parameter. |
Yes, sorry for this big delay. Would you mind addind a test for this part? |
Please see this notebook showing why we believe it is better idea to keep it as is. 02_ar_modelling_in_sklearn_patched.ipynb.zip FYI |
check for horizon before X_fit is transformed